package com.newsmanagement.controller.user;

import com.newsmanagement.mapper.SlauFarmBatchMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/farmBatch")
public class SlauFarmBatchController {

    @Autowired
    private SlauFarmBatchMapper slauFarmBatchMapper;

    /**
     * 获取所有养殖企业进场编号列表
     */
    @GetMapping("/batchList")
    public List<Map<String, Object>> getFarmBatchList() {
        return slauFarmBatchMapper.selectFarmBatchList();
    }

    /**
     * 根据进场编号查询产品品种
     */
    @GetMapping("/productTypeByBatchId")
    public String getProductTypeByBatchId(@RequestParam String batchId) {
        return slauFarmBatchMapper.selectProductTypeByBatchId(batchId);
    }
}